/*
 * SignHistoryListItem.java
 * business
 *
 * Created by SunDing on 2016/12/28.
 *
 * Copyright (c) 2016年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.ui.widget.listview.displaylistitem;

import android.content.Context;

import com.yidiandao.business.R;
import com.yidiandao.business.data.model.ISignModel;
import com.yidiandao.business.data.response.RaffleRecordResponse;
import com.yidiandao.business.ui.widget.listview.DisplayListItem;
import com.yidiandao.business.ui.widget.listview.viewholder.SignHistoryHolder;
import com.yidiandao.business.utils.UIUtils;

/** 抽奖记录 */
public class SignHistoryListItem
        extends DisplayListItem<SignHistoryHolder, RaffleRecordResponse.DataBean.DrawRecordBean> {

    public SignHistoryListItem(RaffleRecordResponse.DataBean.DrawRecordBean s) {
        super(s);
    }

    @Override
    public void onShow(final Context context, SignHistoryHolder holder) {
        holder.mTvTime.setText(data.getDrawTime());
        holder.mTvInfo.setText(data.getDrawDetails());
        if (data.getType().equals(ISignModel.RaffleType.SUCCESS)) {
            holder.mTvInfo.setTextColor(UIUtils.getColor(R.color.colorSelector));
        } else {
            holder.mTvInfo.setTextColor(UIUtils.getColor(R.color.text_color_5));
        }
    }

    @Override
    public String getDisplayItemTag() {
        return SignHistoryListItem.class.getSimpleName();
    }

    @Override
    public Class<SignHistoryHolder> getViewHolderClazz() {
        return SignHistoryHolder.class;
    }
}
